package com.wanlian.model;

/**
 * ClassName: 通用的返回结构 <br/>
 * date: 2017年6月23日 上午10:02:13 <br/>
 *
 * @author huanglonghao
 * @version 0.0.1-SNAPSHOT
 */
public class ResultModel {
    /**
     * 结果正确与否
     */
    private boolean bresult;

    /**
     * 结果信息
     */
    private String message;

    /**
     * 结果url
     */
    private String url;

    /**
     * 结果集（可以为任意数据）
     */
    private Object object;

    private long count;

    private int errorTag;

    public ResultModel() {
        this.bresult = true;
    }

    public ResultModel(boolean bresult) {
        this.bresult = true;
    }

    public ResultModel(boolean bresult, Object data) {
        this.bresult = bresult;
        this.object = data;
    }

    public ResultModel(boolean bresult, Object data, long count) {
        this.bresult = bresult;
        this.object = data;
        this.count = count;
    }

    public ResultModel(boolean bresult, Object data, String message) {
        this.bresult = bresult;
        this.object = data;
        this.message = message;
    }


    public boolean isBresult() {
        return bresult;
    }

    public void setBresult(boolean bresult) {
        this.bresult = bresult;
    }


    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    public int getErrorTag() {
        return errorTag;
    }

    public void setErrorTag(int errorTag) {
        this.errorTag = errorTag;
        this.setMessage("用户未登录或登录已过期");
    }

}
